package it.sd.wdc.spider.repository;

import java.util.Iterator;
import java.util.LinkedList;

public class WDCService extends WDCAbstractStep {

    private LinkedList<WDCStep> steps = new LinkedList<WDCStep>();    
    
    public WDCStep getFirstStep() {
    	return steps.getFirst();
    }
    
    public WDCStep getStep(String id) {
    	WDCStep step = null;
    	
    	for (Iterator<WDCStep> iterator = steps.iterator(); iterator.hasNext();) {
			WDCStep s = iterator.next();
			if (s.getName().equals(id)) {
				step = s;
				break;
			}
			
		}
    	
    	return step;
    }
    
    public Iterator<WDCStep> iterateSteps() {
    	return steps.iterator();
    }
    
    public void addStep(WDCStep step) {
    	steps.add(step);
    }
    
}
